/******************************************************************
******** 
 * ++ 
 * Author:    Team 1
 * Module Name  :  Board.h
 * 
 * Description  : Source file for class Board
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
 *                
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
 * 
 * Mod. History :  18.06.13 - Truong Cong Hau
 *                            File first created 
 *                            MP PROJECT 
 *						      Initialize, control and manage main function of program
 * -- 
 
*******************************************************************
*****/

#pragma once
#ifndef BOARD_H
#define BOARD_H

//File header
#include <ObjIdl.h>
#include <gdiplus.h>
#include <atlbase.h>
#include <string.h>
#include <string>
#include <list>
#include <stdlib.h>

//Include files
#include "ChessPiece.h"
#include "stdafx.h"
#include "Player.h"
#include <vector>

using namespace std;

class Board
{
public:
	//
	GdiplusImagePtr m_pImage;
	//
	ChessPiece* m_plsBoardCell[BoardInfo::row][BoardInfo::col];
	//
	ChessPiece* m_plsPiece[BoardInfo::piecesEachSide * BoardInfo::sideCount];
	//
	list<ChessPiece*> plsDeadPiece;
	//
	vector<string> plszLstLog;
	//
	ChessPiece* m_pChosenPiece;
	//
	Player players;
public:
	//
	Board(void);
	//
	~Board(void);
	
	//
	void Draw(Gdiplus::Graphics &graphics);
	//
	void SetBoard(std::string boardDir);
	//
	bool IsLegitClick(POINT position);
	//
	void InitializeChessPiece();
	//
	void ClearUp();
	//
	void MovePiece(HWND hListBox,POINT position);
	//
	void WriteLog();
	//
	void CreateNewGame();
	//
	bool DoesNextMoveExist();
	//
	void GetGameState();
	//
	bool HasPieceAt(POINT position);
	//
	bool HasPieceAt(int posX, int posY);
	//
	void Click(HWND hListBox,POINT position);
	//
	void MoveAuto();

	//void Re

	//int CountNumberPieceSameTypeInColumn(char* nameclass, int col);
};
#endif

